home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_bas / pbc32.zip / LIBRARY.TXT < prev    next >
Text File  |  1996-04-10  |  3KB  |  78 lines

  1. So you've never used a library before and you want to know what
  2. gives?
  3.  
  4. A library is a collection of routines, whether written in BASIC,
  5. assembly language, or some other language altogether. It
  6. provides a convenient way to allow different programs to use the
  7. same sets of standard or special-purpose routines (subprograms
  8. or functions, in BASIC parlance).
  9.  
  10. There are two forms of libraries for QuickBASIC. The form with
  11. the extension ".LIB" is for use with LINK, for creating
  12. stand-alone programs which do not require the QuickBASIC
  13. environment. This sort of library can be made or manipulated
  14. using the LIB utility provided with QuickBASIC. The form of
  15. library with the extension ".QLB" is for use in the QuickBASIC
  16. environment. It is created with LINK and (unfortunately) can't
  17. be manipulated at all.
  18.  
  19. To use a QLB library, you specify the /L parameter when starting
  20. up QB:
  21.  
  22.    QB /L PBCLONE
  23.  
  24. You can optionally include the name of your program before the
  25. /L switch.
  26.  
  27. To use a LIB library, you specify the name of the library when
  28. you LINK your program. Either let LINK prompt you for the
  29. library or type something like this:
  30.  
  31.    BC program/O;                       (or whatever)
  32.    LINK program/EX,,NUL,PBCLONE
  33.  
  34. If you are in the QuickBASIC environment and direct the compiler
  35. to produce an .EXE file, it will automatically link the library
  36. for you if you started up QB with the /L option.
  37.  
  38. Suppose you have more than one library that you wish to use?
  39. Well, provided that you have both of the libraries in .LIB form,
  40. this presents no problem. To create a combined .LIB library, use
  41. the LIB utility to extract all of the .OBJ files from one .LIB
  42. and add them to the other one. You can convert the new combined
  43. library to .QLB form by using a special LINK syntax:
  44.  
  45.    LINK combined.LIB/Q/SE:1024,,NUL,BQLB45;
  46.  
  47. The last two digits of "BQLBxx" represent the version of the
  48. compiler that you have. It doesn't necessarily match the formal
  49. version number, though, so you might just want to use DIR and
  50. see what the name of the file really is. BQLBxx.LIB is one of
  51. the files that comes with QuickBASIC. If you have QBX, use
  52. QBXQLB instead of BQLBxx.
  53.  
  54. The "/SE:1024" part is only needed when dealing with large
  55. libraries, such as PBClone. It tells LINK to allocate more space
  56. for its internal tables. This doesn't affect the size of the
  57. resulting library, though, so it never hurts to use this
  58. parameter.
  59.  
  60. If you experience a LINK error, make sure that you're using the
  61. current version of LINK. I've heard from many people who turn
  62. out to have the wrong version of LINK in their PATH somewhere...
  63. when LINK starts up, it will display its version number on the
  64. screen. The version should be around 3.69 as of QuickBASIC 4.5,
  65. or 5.05 for QBX. You must use the LINK that came with
  66. QuickBASIC-- the one that comes with Quick C is incompatible and
  67. the one that came with BASCOM 6.0 (the one with two periods in
  68. the version number) has a few bugs.
  69.  
  70. If you are using BASCOM 7.0, DO NOT interrupt LINK with a Break
  71. or Control-C, as this may cause it to damage your hard disk!!!
  72. This bug is known to appear in the LINK that comes with BASCOM
  73. 7.0. I'm not sure whether they fixed it in BASCOM 7.1. You may
  74. be more familiar with BASCOM 7.x as "PDS" or "The Professional
  75. Development System" (Marketing, ugh).
  76.  
  77. All clear? No?! Check your BASIC manuals for more information!
  78.